package com.youlin.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@NoArgsConstructor
@Data
@Accessors(chain=true)
public class BaseResDto<T> {

    @ApiModelProperty(value="业务响应状态码：1000-请求成功，1001-请求失败，1002-请求参数错误，" +
            "1005-权限不足，1006-未登录, 1027-请重新登录(密码已重置或账号已在其它终端登录)", position = 1)
    private Integer status;

    @ApiModelProperty(value="业务响应信息", position = 2)
    private String message;

    public BaseResDto(Status status) {
        this.status = status.getValue();
        this.message = status.getMessage();
    }

    public BaseResDto(Status status, String message) {
        this.status = status.getValue();
        this.message = message;
    }

}
